/**
 * 耗时计算
 */
class ElapsedTime {

    constructor() {
        this.start = performance.now();
        this.end = 0;
    }

    /**
     * 停止并返回耗时
     *
     * @return {string}
     */
    stop() {
        this.end = performance.now();
        return (this.end - this.start).toFixed(0);
    }
}

module.exports = {
    ElapsedTime
};